USE[DeltaFlex]
GO
IF(OBJECT_ID('dbo.FACTURA')IS NOT NULL)
	DROP table dbo.FACTURA
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE FACTURA(IDFACTURA int NOT NULL,
					 IDCLIENT int NOT NULL,
					 DATA date NOT NULL,
					 VENCIMENT date NOT NULL,
					 TOTAL decimal(8,4) NOT NULL

	
 CONSTRAINT PK_FACTURA PRIMARY KEY CLUSTERED 
(
	IDFACTURA  ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

IF (OBJECT_ID('SEQ_FACTURA')IS NOT NULL)
	DROP SEQUENCE SEQ_FACTURA
GO

CREATE SEQUENCE SEQ_FACTURA
	START WITH 1
    INCREMENT BY 1
    MINVALUE 1
    MAXVALUE 9223372036854775807;

GO

